package com.capgemini.diabeo.service;

import com.capgemini.diabeo.model.Dish;
import com.capgemini.diabeo.model.Menu;
import com.capgemini.diabeo.model.MenuDish;
import com.capgemini.diabeo.model.MenuDishDao;
import com.googlecode.androidannotations.annotations.EBean;

@EBean
public class MenuDishService extends AbstractDatabaseService {

	public MenuDish createNewMenuDish(Menu menu, Dish dish) {
		MenuDish menuDish = new MenuDish();
		menuDish.setMenu(menu);
		menuDish.setDish(dish);
		MenuDishDao menuDishDao = dbHelper.getMenuDishDao();
		menuDishDao.insert(menuDish);
		return menuDish;
	}

	public void delete(MenuDish menuDish) {
		MenuDishDao menuDishDao = dbHelper.getMenuDishDao();
		menuDishDao.delete(menuDish);
	}
}
